module.exports = function (app) {
  app.get('/some/path', function (req, res) {
    res.json({ custom: 'response' });
  });
  app.post('/login', function (req, res) {
    // req 对应的是请求信息
    let str = '';
    req.on('data', function (chunk) {
      str += chunk
    })
    req.on('end', function () {
      console.log(str)
      let obj = JSON.parse(str)
      if (obj.name == 1 && obj.psw == 23) {
        res.json({
          code: 0,
          userInfo: {
            name: "zhufeng",
            age: 13
          }
        })
      } else {
        res.json({
          code: 1,
          msg: '用户名密码错误'
        })
      }
    })
    // console.log(req)

  })
}